package com.sjh.controller;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletResponse;

import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sjh.service.ISjh_service;
import com.sjh.vo.Bis_nurse_project;
import com.sjh.vo.Bis_nurse_type;

@Controller
public class QtSjh_controller {
		@Autowired
		private ISjh_service sjh_service;
		//前台显示所有
		@RequestMapping("qtselectBis")
		public String qtselectBis(Map<String, Object> map,Bis_nurse_project project){
			List<Map> qtlist = sjh_service.qtselectBis(project);
			map.put("qtlist", qtlist);
			
			List<Bis_nurse_type> list = sjh_service.addtype();
			map.put("listb", list);
			return "qtsjh/selectProject";
		}
		
				//护理详情
				@RequestMapping(value="qtselectById",produces = "text/plain;charset=utf-8")
				@ResponseBody
				public String selectByid(String project_id,HttpServletResponse response){
					String jsonStr = "";
					try {
						jsonStr = new ObjectMapper().writeValueAsString(sjh_service.qtselectById(project_id));
					} catch (Exception e) {
					}
					return jsonStr;
				}
		
		@RequestMapping("ceinfo")
		public String ceinfo(){
			return "qtsjh/sjhfinanceinfo";
		}
}
